<%@ page language="java" import="java.util.*,ct.zxd.db.*" pageEncoding="utf-8"
contentType="text/html"
%>
<html lang="zh-cn">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta name="renderer" content="webkit">
	<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
	<title></title>
	<link rel="stylesheet" href="css/pintuer.css">
	<link rel="stylesheet" href="css/admin.css">
	<script src="js/jquery.js"></script>
	<script src="js/pintuer.js"></script>
 </head>
<%
	String shop = request.getParameter("shop");
	//shop = new String(shop.getBytes("iso-8859-1"),"utf-8");
	
	String updateShowID = request.getParameter("show");
	//updateShowID = updateShowID==null ? "" : new String(updateShowID.getBytes("iso-8859-1"),"utf-8");
	updateShowID = updateShowID==null ? "" : updateShowID;
	
	String updateCateName = request.getParameter("cateName");
	//updateCateName = updateCateName==null ? "" : new String(updateCateName.trim().getBytes("iso-8859-1"),"utf-8");
	updateCateName = updateCateName==null ? "" : updateCateName;
	
	String err = (String)request.getAttribute("err");
	if(err==null)err="";
	
	String buttonStyle = "button bg-main icon-check-square-o";
	String buttonText = "提交";
	String flag = request.getParameter("flag");
	String buttonAbled = "";
	if(flag==null){
	   buttonAbled = "disabled=true";
	}else if(flag.equals("del")){
			buttonStyle = "button bg-red icon-trash-o";
			buttonText = "删除";
			err="注意！删除分类前，请删除该分类下的所有商品，否则会报错。";
	}	
%>
 <body>
	<div class="panel-head"><strong><br><span class="icon-pencil-square-o"></span> 增加分类</strong></div>
    <div class="body-content">
    <form method="post" class="form-x" action="HandleCategory?flag=<%=flag%>&shop=<%=shop%>">
      <div class="form-group">
        <div class="label">
          <label>编号：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="<%=updateShowID %>" name="showid" readonly=true/>
          <div class="tips"></div>
        </div>
      </div>
    
      <div class="form-group">
        <div class="label">
          <label>名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" maxlength="4" value="<%=updateCateName %>" name="title" data-validate="required:请输入标题" />
          <div class="tips"></div>
           &nbsp;&nbsp;
          <font color="red"><%=err %></font>
        </div>
      </div>

      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="<%=buttonStyle %>" type="submit" <%=buttonAbled %>> <%=buttonText %></button>
        </div>
      </div>
    </form>
  </div>
  </body>
</html>
